import Cookies from 'js-cookie'

const TokenKey = 'vue_admin_template_token'
// 获取token
export function getToken() {
  return Cookies.get(TokenKey)
}
// 存储token在cookie中
export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
// 存储时间戳逻辑
const timeKey = 'vue-admin-time-key'
// 存储时间戳
export function saveTime() {
  Cookies.set(timeKey, Date.now())
}

// 读取时间戳
export function getTime() {
  return Cookies.get(timeKey)
}
